home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
programm
/
prog_a2m
/
dblscrll
/
dblscrll.lst
< prev
Wrap
File List
|
1995-05-02
|
2KB
|
86 lines
'
' Demonstration of TOS 1.4 (and above) mouse doubling bug
' By Charles F. Johnson
'
DEFINT "a-z"
DIM message_buffer&(7),x(4),y(4)
adr_mes=V:message_buffer&(0)
ABSOLUTE word0&,adr_mes
ABSOLUTE x&,adr_mes+8
ABSOLUTE y&,adr_mes+10
ABSOLUTE w&,adr_mes+12
ABSOLUTE h&,adr_mes+14
'
~WIND_GET(0,5,x0,y0,w0,h0)
fill.screen(x0,y0,x0+w0-1,y0+h0-1)
title$=" Click arrows to demonstrate "+CHR$(0)
info$=" Click 'Full' button - Timer is now ON"+CHR$(0)
handle&=WIND_CREATE(&X11010111,0,19,639,380)
adr_title=V:title$
~WIND_SET(handle&,2,CARD(SWAP(adr_title)),CARD(adr_title),0,0)
set.info
~WIND_OPEN(handle&,200,80,360,200)
~WIND_GET(handle&,4,wx&,wy&,ww&,wh&)
BOUNDARY 0
PBOX wx&,wy&,wx&+ww&-1,wy&+wh&-1
BOUNDARY 1
events&=&X110001 ! Initialize to timer, message, and keyboard events
finish!=FALSE
timeval=0
'
REPEAT
'
' We're using a timer length of zero. Increasing the timer value
' does somewhat alleviate the doubling up problem, but it still
' happens occasionally.
'
event=EVNT_MULTI(events&,0,0,0,0,0,0,0,0,0,0,0,0,0,adr_mes,timeval,d,d,d,d,key,d)
IF BTST(event,0)
SELECT BYTE(key)
CASE 27
finish!=TRUE
ENDSELECT
ELSE IF BTST(event,4)
SELECT word0&
CASE 22 ! WM_CLOSED - closed
finish!=TRUE
CASE 23 ! WM_FULLED - full size
IF events&=&X110001
info$=" Click 'Full' button - Timer is now OFF"+CHR$(0)
set.info
events&=&X10001
ELSE
info$=" Click 'Full' button - Timer is now ON"+CHR$(0)
set.info
events&=&X110001
ENDIF
word0&=0
CASE 24 ! WM_ARROWED
~WIND_UPDATE(1)
PRINT "Arrow message received."
IF CRSLIN>=25
fill.screen(x0,y0,x0+184,y0+h0-1)
ENDIF
~WIND_UPDATE(0)
word0&=0
ENDSELECT
ENDIF
UNTIL finish!
~WIND_CLOSE(handle&)
~WIND_DELETE(handle&)
END
'
PROCEDURE fill.screen(x1,y1,x2,y2)
DEFFILL 1,2,4
BOUNDARY 0
PBOX x1,y1,x2,y2
BOUNDARY 1
DEFFILL 1,0
PRINT AT(1,1);"";
RETURN
'
PROCEDURE set.info
adr_info=V:info$
~WIND_SET(handle&,3,CARD(SWAP(adr_info)),CARD(adr_info),0,0)
RETURN